﻿using AppService.IService.System_order;
using Domain.Entity.Basic_information;
using Domain.Entity.Order_goods;
using Domain.Entity.System_dictionary;
using Domain.Entity.System_operation;
using Domain.Entity.System_Ordermanagement;
using Domain.IRepository.System_Order;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata.Ecma335;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;

namespace AppService.Service.System_order
{
    [Dependency(ServiceLifetime.Scoped)]
    public class OrderService : IorderService
    {
        private readonly IOrderRepository orderRepository;

        public OrderService(IOrderRepository orderRepository)
        {
            this.orderRepository = orderRepository;
        }

        public bool Add(Wb_meter wb_Meter)
        {
            return orderRepository.Add(wb_Meter) > 0;
        }

        public bool AddOr(Orders orders)
        {
            return orderRepository.Add(orders) > 0;
        }

        public bool AddOrders_good(Order_good order_Good)
        {
            return orderRepository.AddOrders_good(order_Good) > 0;
        }

        public int Count(int Ord_state, string Ord_startaddress, string Ord_destination, string Ord_time, string Client_name)
        {
            return orderRepository.Count(Ord_state, Ord_startaddress, Ord_destination, Ord_time, Client_name);
        }

        public List<Cargo_ment> GetCargo_Ments()
        {
            return orderRepository.GetCargo_Ments();
        }

        public List<Carrier_ment> GetCarrier_Ments()
        {
            return orderRepository.GetCarrier_Ments();
        }

        public List<Customer_ment> GetCustomer_Ments()
        {
            return orderRepository.GetCustomer_Ments();
        }

        public List<Customer_ment> GetCustomer_Ments_name(string Ct_name)
        {
            return orderRepository.GetCustomer_Ments_name(Ct_name);
        }

        public List<Drivers_ment> GetDrivers_Ments(int Dv_carrier)
        {
            return orderRepository.GetDrivers_Ments(Dv_carrier);
        }

        public List<Drivers_ment> GetDrivers_Ments_id(int Dv_id)
        {
            return orderRepository.GetDrivers_Ments_id(Dv_id);
        }

        public List<Order_good_cargo> GetOgc(string Ord_number)
        {
            return orderRepository.GetOgc(Ord_number);
        }

        public List<Orders> GetOrders(int currentPage, int PageSize)
        {
            return orderRepository.GetOrders(currentPage, PageSize);
        }

        public List<Orders> GetOrders_number(string Ord_number)
        {
            return orderRepository.GetOrders_number(Ord_number);
        }

        public List<Orders> GetOrders_state(int state, int currentPage, int PageSize)
        {
            return orderRepository.GetOrders_state(state, currentPage, PageSize);
        }

        public List<Order_cargo> Getorder_Cargos(int Ord_id)
        {
            return orderRepository.Getorder_Cargos(Ord_id);
        }

        public List<Order_client> GetOrder_client(string Ord_number)
        {
            return orderRepository.GetOrder_client(Ord_number);
        }

        public List<Sys_dict_data> GetSys_dict_data()
        {
            return orderRepository.GetSys_dict_data();
        }

        public List<Vehicles_ment> Getvehicles_Ments(int Dv_id)
        {
            return orderRepository.Getvehicles_Ments(Dv_id);
        }

        public bool JD(int Ord_id)
        {
            return orderRepository.JD(Ord_id) > 0;
        }

        public bool TH(int Ord_id)
        {
            return orderRepository.TH(Ord_id) > 0;
        }

        public bool FC(int Ord_id)
        {
            return orderRepository.FC(Ord_id) > 0;
        }

        public bool DZ(int Ord_id)
        {
            return orderRepository.DZ(Ord_id) > 0;
        }

        public List<Orders> Orders_condition(int Ord_state, string Ord_startaddress, string Ord_destination, string Ord_time, string Client_name, int currentPage, int PageSize)
        {
            return orderRepository.Orders_condition(Ord_state, Ord_startaddress, Ord_destination, Ord_time, Client_name, currentPage, PageSize);
        }

        public List<Sys_dict_data> sys_Dict_Datas(int Dv_model, int Dv_length)
        {
            return orderRepository.sys_Dict_Datas(Dv_model, Dv_length);
        }

        public bool HD(int Ord_id)
        {
            return orderRepository.HD(Ord_id) > 0;
        }
    }
}
